package com.gk.javaservice.service.impl;

import com.gk.javaservice.dao.AdminRolePermissionsDao;
import com.gk.javaservice.po.AdminRolePermissions;
import com.gk.javaservice.service.AdminRolePermissionsService;
import com.gk.javaservice.util.time.TimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminRolePermissionsServiceImpl implements AdminRolePermissionsService {

    @Autowired
    private AdminRolePermissionsDao baseDao;

    @Override
    public void add(AdminRolePermissions baseBean) {
        String getTime = TimeUtil.dateFormat();
        baseBean.setCreatedAt(getTime);
        baseBean.setUpdatedAt(getTime);
        baseDao.add(baseBean);
    }

    @Override
    public Integer update(AdminRolePermissions baseBean) {
        String getTime = TimeUtil.dateFormat();
        baseBean.setUpdatedAt(getTime);
        return baseDao.update(baseBean);
    }

    @Override
    public Integer delete(Object id) {
        return baseDao.delete(id);
    }

    @Override
    public List<AdminRolePermissions> hasAll() {
        return baseDao.hasAll();
    }

    @Override
    public AdminRolePermissions hasById(Object id) {
        return baseDao.hasById(id);
    }
    @Override
    public List<AdminRolePermissions> hasAllById(String id) {
        return baseDao.hasAllById(id);
    }

}
